package com.kaia.shoebox.adapter;

import android.app.ActionBar.Tab;
import android.app.ActionBar.TabListener;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;

import com.kaia.shoebox.R;
import com.kaia.shoebox.activity.ShoeboxMain;
import com.kaia.shoebox.fragment.BaseListFragment;

public class SwitchFragmentListener<T extends Fragment> implements TabListener {

	private final Activity mActivity;
	private final String mTag;
	private final Class<T> mClass;
	private Fragment mFrag;

	public SwitchFragmentListener(Activity activity, String tag, Class<T> clazz) {
		mActivity = activity;
		mTag = tag;
		mClass = clazz;
	}

	@Override
	public void onTabReselected(Tab tab, FragmentTransaction ft) {

	}

	@Override
	public void onTabSelected(Tab tab, FragmentTransaction ignored) {
		if(mFrag == null){
			
		}
	}

	@Override
	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
		if (mFrag != null) {
			ft.detach(mFrag);
		}
	}

}
